package main

import "fmt"

func main() {

	//转换
	var v1 int = 16
	var v2 float64 = 3.1415926
	var v3 bool = false
	var v4 byte = 'a'

	//int -> 字符串
	var s1 = fmt.Sprintf("%d", v1)
	fmt.Printf("s1对应的类型是: %T, s1的值=%v", s1, s1)
	fmt.Println()

	//float -> 字符串
	var s2 = fmt.Sprintf("%f", v2)
	fmt.Printf("s1对应的类型是: %T, s1的值=%v", s2, s2)
	fmt.Println()

	//bool -> 字符串
	var s3 = fmt.Sprintf("%t", v3)
	fmt.Printf("s1对应的类型是: %T, s1的值=%v", s3, s3)
	fmt.Println()

	//字符 -> 字符串
	var s4 = fmt.Sprintf("%c", v4)
	fmt.Printf("s1对应的类型是: %T, s1的值=%v", s4, s4)
	fmt.Println()

}
